package demo;


class Alg <E extends Comparable<E>>{



    public E findMax(E[] array) {
        E max = array[0];
        for (int i = 0; i < array.length; i++) {
            if (max.compareTo(array[i]) < 0) {
                max = array[i];
            }
        }
        return max;
    }
}

public class Test {

    public static void main(String[] args) {
        Alg<Integer> alg = new Alg<>();
        Integer[] array = {2,5,8,4,17,26,9};
        Integer val = alg.findMax(array);
        System.out.println(alg.findMax(array));
        System.out.println(val);
    }

}
